package com.soecode.wxtools.bean;

import java.io.IOException;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

import com.soecode.wxtools.bean.result.WxError;

/**
 * 客服
 * 
 * @author lenovo
 *
 */
public class WxKf extends WxError {

	private String kf_account;
	private String kf_headimgurl;
	private int kf_id;
	private String kf_nick;
	private String kf_wx;
	private String invite_wx;
	private String invite_expire_time;
	private String invite_status;

	public String getKf_account() {
		return kf_account;
	}

	public void setKf_account(String kf_account) {
		this.kf_account = kf_account;
	}

	public String getKf_headimgurl() {
		return kf_headimgurl;
	}

	public void setKf_headimgurl(String kf_headimgurl) {
		this.kf_headimgurl = kf_headimgurl;
	}

	public int getKf_id() {
		return kf_id;
	}

	public void setKf_id(int kf_id) {
		this.kf_id = kf_id;
	}

	public String getKf_nick() {
		return kf_nick;
	}

	public void setKf_nick(String kf_nick) {
		this.kf_nick = kf_nick;
	}

	public String getKf_wx() {
		return kf_wx;
	}

	public void setKf_wx(String kf_wx) {
		this.kf_wx = kf_wx;
	}

	public String getInvite_wx() {
		return invite_wx;
	}

	public void setInvite_wx(String invite_wx) {
		this.invite_wx = invite_wx;
	}

	public String getInvite_expire_time() {
		return invite_expire_time;
	}

	public void setInvite_expire_time(String invite_expire_time) {
		this.invite_expire_time = invite_expire_time;
	}

	public String getInvite_status() {
		return invite_status;
	}

	public void setInvite_status(String invite_status) {
		this.invite_status = invite_status;
	}

	@Override
	public String toString() {
		return "WxKf [kf_account=" + kf_account + ", kf_headimgurl=" + kf_headimgurl + ", kf_id=" + kf_id + ", kf_nick="
				+ kf_nick + ", kf_wx=" + kf_wx + ", invite_wx=" + invite_wx + ", invite_expire_time="
				+ invite_expire_time + ", invite_status=" + invite_status + "]";
	}

	/**
	 * json --> obj
	 * 
	 * @param json
	 * @return
	 * @throws JsonParseException
	 * @throws JsonMappingException
	 * @throws IOException
	 */
	public static WxKf fromJson(String json) throws JsonParseException, JsonMappingException, IOException {
		ObjectMapper mapper = new ObjectMapper();
		mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
		return mapper.readValue(json, WxKf.class);
	}

}
